home *** CD-ROM | disk | FTP | other *** search
Text File | 1989-04-19 | 1.6 KB | 39 lines | [TEXT/GEOL] |
- Item 2386582 19-April-89 02:07
-
- From: ROLLIN1 Rollin, Keith A.
-
- To: MACAPP.TECH$ MACAPP Tech
-
- Sub: Re- Segmentation changes?
-
-
- >Would it be feasible to change some of the more commonly used routines such as
- >TStaticText.SetText to be resident so that one could pass a string field of an
- >object without first copying it into a local string? Regards, Les Caudle
-
- I'm afraid that making a program segment resident won't help you here, Les.
-
- In a way, you can consider that an object is divided into two parts: its data
- and its methods. The methods are the actual procedures that get executed, and
- are stored in CODE segments. It is these CODE segments that get locked down
- when you make something resident.
-
- The data for each object (its "instance variables") are stored in blocks of
- memory referenced by the object's handle. It is this block of data that tends
- to move around when memory shuffling goes on, and causes one to have to copy
- certain instance variables into local variables. Making a CODE segment resident
- does not have any effect on the object handle's nomadic tendancies.
-
- One thing that you *COULD* do is call SELF.Lock before calling a procedure that
- needs a string (or similar) parameter and that can cause memory to be moved.
- However, IT IS VERY IMPORTANT THAT YOU RESTORE THE HANDLE'S PREVIOUS LOCKED
- SETTING AFTERWARDS! I'm sorry if I'm preaching to the converted on this issue,
- but it's very easy for memory fragmentation to screw up MacApp's memory
- management system.
-
- I hope this helps,
-
- - Keith Rollin
- - Apple Developer Technical Support
-
-